<?php

class Zend_View_Helper_Teaser {

    public function teaser($body) {
        $filter = new Zend_Filter_StripTags();
        $body = $filter->filter($body);
        $words = str_word_count($body);
        if ($words > 20) {
            $text = explode('\0',wordwrap($body, 300, '\0'));
            return $text[0];
        } else {
            return $body;
        }
    }

}
